package model;

import java.text.DateFormat;
import java.util.HashMap;
import java.util.Set;

public class SpecialOrder {

	private int id;
	private DateFormat date;
	private boolean isPaid;
	private String status;
	private int customerId;
	private String deliveryDate;
	private String delivery;
	private HashMap<Integer,Integer> items;
	
	public SpecialOrder(int id, DateFormat date, boolean isPaid, String status, int customerId, String deliveryDate, String delivery) {
		this.id = id;
		this.date = date;
		this.isPaid = isPaid;
		this.status = status;
		this.customerId = customerId;
		this.deliveryDate = deliveryDate;
		this.delivery = delivery;
		this.items = new HashMap<Integer,Integer>();
	}
	
	public int getSpecialOrderId() {
		return id;
	}
	
	public void setSpecialOrderId(int id) {
		this.id = id;
	}
	
	public DateFormat getDate() {
		return date;
	}
	
	public void setDate(DateFormat date) {
		this.date = date;
	}
	
	public boolean isPaid() {
		return isPaid;
	}

	public void setPaid(boolean isPaid) {
		this.isPaid = isPaid;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public int getCustomerId() {
		return customerId;
	}
	
	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}

	public String getDeliveryDate() {
	return deliveryDate;
	}
	
	public void setDeliveryDate(String deliveryDate) {
		this.deliveryDate = deliveryDate;
	}
	
	public String getDelivery() {
		return delivery;
	}
	
	public void setDelivery(String delivery) {
		this.delivery = delivery;
	}

	public void addItem(int itemId, int amount) {
		int i = amount;
		if(!(items.get(itemId) == null)){
			i = items.get(itemId) + 1;
		}
//		System.out.println(i);
		items.put(itemId, i);
	}
	
	public void remove(int itemId) {
		items.remove(itemId);
	}
	public Set<Integer> getItems() {
		return items.keySet();
	}
	
	public HashMap<Integer,Integer> getItemsMap(){
		return items;
	}

	public int getSize(){
		return items.size();
	}
	
	public HashMap<Integer,Integer> getHashMap(){
		return items;
	}
}


